package demo1;

public class Animal {
    public int age;
    public String name;
    public Animal() {
        System.out.println("调用父类无参构造方法！");
    }
    public Animal(int age, String name) {
        this.age = age;
        this.name = name;
        System.out.println("调用父类含参构造方法！");
    }

    public void sleep() {
        System.out.println(this.name+"在睡觉");
    }
}
